﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HeBianGu.Product.UserControls.SystemKeyBoard
{
    /// <summary>
    /// PopupuNumKeyWord.xaml 的交互逻辑
    /// </summary>
    public partial class PopupuNumKeyWord : UserControl
    {
        public PopupuNumKeyWord()
        {
            InitializeComponent();
            this.GridNumKey.Focus();
        }


        public ICommand SubmitCilck
        {
            get { return (ICommand)GetValue(SubmitCilckProperty); }
            set { SetValue(SubmitCilckProperty, value); }
        }


        public static readonly DependencyProperty SubmitCilckProperty =
         DependencyProperty.Register("SubmitCilck", typeof(ICommand), typeof(PopupuNumKeyWord));

     
        public string Value
        {
            get { return (string)GetValue(ValueProperty); }
            set { SetValue(ValueProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Value.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ValueProperty =
            DependencyProperty.Register("Value", typeof(string), typeof(PopupuNumKeyWord), new UIPropertyMetadata(string.Empty));



        public bool IsChecked
        {
            get { return (bool)GetValue(IsCheckedProperty); }
            set { SetValue(IsCheckedProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IsChecked.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsCheckedProperty =
            DependencyProperty.Register("IsChecked", typeof(bool), typeof(PopupuNumKeyWord), new UIPropertyMetadata(false));


        private void btnMin_Click(object sender, RoutedEventArgs e)
        {
            Value = string.Empty;
        }

        private void AddNumber(string num)
        {

            Value += num;

        }


        private void button2_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(2.ToString());
        }

        private void button3_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(3.ToString());
        }

        private void button4_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(4.ToString());
        }

        private void button5_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(5.ToString());
        }

        private void button6_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(6.ToString());
        }

        private void button7_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(7.ToString());
        }

        private void button8_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(8.ToString());
        }

        private void button9_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(9.ToString());
        }

        private void button0_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(0.ToString());
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            AddNumber(1.ToString());
        }

        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
           
        }
    }
}
